﻿<%@ Page Language="C#" MasterPageFile="~/Home/ad/admin.master" AutoEventWireup="true" CodeFile="ad_dmsp.aspx.cs" Inherits="Home_ad_ad_dmsp" Title="Welcome to IT" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<br />
<table align="center" width=100% cellpadding=0 cellspacing=0>
    <tr valign=top>
        <td style="width: 77px">
        </td>
        <td>      
          <asp:Label ID="Lbloi" runat="server" Text="" ForeColor=red class="style16"></asp:Label>
          
          <asp:Label ID="Lbss" runat="server" Text="" ForeColor="#3300ff"></asp:Label>
        </td>
     </tr>
    <tr valign=top>
        
        <td style="width: 77px">
        </td>
        <td>
            Tên danh mục<asp:TextBox ID="txtdm" runat="server"></asp:TextBox>
            <asp:Button ID="bt" runat="server" Text="Thêm danh mục mới" OnClick="bt_Click" Width="132px" />
        
        </td>
    </tr>
    <tr>
        <td style="width: 77px">
        
        </td>
        <td>
            &nbsp;&nbsp;&nbsp;
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
                AutoGenerateColumns="False" CellPadding="4" DataKeyNames="ID" DataSourceID="sql_dmsp"
                ForeColor="#333333" GridLines="None" Width="395px">
                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <Columns>
                    <asp:BoundField DataField="ID" HeaderText="M&#227;" InsertVisible="False" ReadOnly="True"
                        SortExpression="ID" />
                    <asp:BoundField DataField="DienGiai" HeaderText="T&#234;n danh mục" SortExpression="DienGiai" />
                    <asp:CommandField ButtonType="Button" CancelText="[Hủy bỏ]" EditText="[Sửa]"
                        ShowEditButton="True" UpdateText="[Cập nhật]" />
                    <asp:CommandField ButtonType="Button" DeleteText="[X&#243;a]" ShowDeleteButton="True" />
                </Columns>
                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                <EditRowStyle BackColor="#999999" />
                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            </asp:GridView>
            <asp:SqlDataSource ID="sql_dmsp" runat="server" ConnectionString="<%$ ConnectionStrings:db_connection %>"
                DeleteCommand="DELETE FROM [DM001] WHERE [ID] = @original_ID AND [DienGiai] = @original_DienGiai" InsertCommand="INSERT INTO [DM001] ([DienGiai]) VALUES (@DienGiai)"
                SelectCommand="SELECT * FROM [DM001] ORDER BY [ID]" UpdateCommand="UPDATE [DM001] SET [DienGiai] = @DienGiai WHERE [ID] = @original_ID AND [DienGiai] = @original_DienGiai" ConflictDetection="CompareAllValues" OldValuesParameterFormatString="original_{0}">
                <DeleteParameters>
                    <asp:Parameter Name="original_ID" Type="Int32" />
                    <asp:Parameter Name="original_DienGiai" Type="String" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="DienGiai" Type="String" />
                    <asp:Parameter Name="original_ID" Type="Int32" />
                    <asp:Parameter Name="original_DienGiai" Type="String" />
                </UpdateParameters>
                <InsertParameters>
                    <asp:Parameter Name="DienGiai" Type="String" />
                </InsertParameters>
            </asp:SqlDataSource>
            <br />
           
    
        </td>
    </tr>
</table>
    &nbsp;
    
  
</asp:Content>

